package com.santiao.fuel.network


import com.santiao.fuel.bean.RYCommonConfigBean
import com.santiao.fuel.AppConst
import com.santiao.fuel.bean.RYHelpQuestionBean
import com.santiao.fuel.bean.RYOpenMemberBean
import com.santiao.fuel.bean.RYActivateBean
import com.santiao.fuel.bean.RYInstalBean
import com.santiao.fuel.bean.RYPhoneLocationBean
import com.santiao.fuel.bean.RYResponseBase
import com.santiao.fuel.bean.RYStartRet
import com.santiao.fuel.bean.RYWhiteListBean
import io.reactivex.Observable
import okhttp3.RequestBody
import retrofit2.http.*

interface HttpApi {

  /**
   * 获取初始化信息
   * @param
   * @return
   * */
  @GET("${AppConst.PATH_SEGMENTS_URL}app/config")
  fun getConfigInit( @Query("pkgName") pkgName: String,
                     @Query("version") version: String,@Query("channel") channel: String): Observable<RYResponseBase<RYStartRet>>

  //Map形式

  @GET("${AppConst.PATH_SEGMENTS_URL}app/v2/config")
  fun getAppConfig(@QueryMap params: Map<String, String>): Observable<RYResponseBase<RYStartRet>>
  /**
   * 获取初始化信息
   * @param
   * @return
   * */
  @POST("${AppConst.PATH_SEGMENTS_URL}app/v2/install")
  fun setInstallHttp(@Body requestBody: RequestBody): Observable<RYResponseBase<RYStartRet>>
  /**
   * 用户行为上报
   * @param
   * @return
   * */
  @POST("${AppConst.PATH_SEGMENTS_URL}app/v2/report")
  fun reportingBehavior(@Body requestBody: RequestBody): Observable<RYResponseBase<RYInstalBean>>
  /**
   * 设备激活
   * @param
   * @return
   * */
  @POST("${AppConst.PATH_SEGMENTS_URL}app/activate")
  fun setActivate(@Body requestBody: RequestBody): Observable<RYResponseBase<RYActivateBean>>
  /**
   * 设备设置为白名单
   * @param
   * @return
   * */
  @POST("${AppConst.PATH_SEGMENTS_URL}app/v2/addWhiteList")
  fun setWhiteList(@Body requestBody: RequestBody): Observable<RYResponseBase<RYWhiteListBean>>

  /**
   * 设置选项日志
   * @param
   * @return
   * */
  @POST("${AppConst.PATH_SEGMENTS_URL}app/set/up")
  fun setAppSetUp(@Body requestBody: RequestBody): Observable<RYResponseBase<RYActivateBean>>
  /**
   * 获取手机归属地
   * @param
   * @return
   * */
  @GET("${AppConst.PATH_SEGMENTS_URL}app/phone/location")
  fun getPhoneLocation(@QueryMap params: Map<String, String>): Observable<RYResponseBase<RYPhoneLocationBean>>
  /**
   * 获取ip
   * @param
   * @return
   * */
  @GET("${AppConst.PATH_SEGMENTS_URL}app/ip/location")
  fun getIpLocation(@QueryMap params: Map<String, String>): Observable<RYResponseBase<RYPhoneLocationBean>>
  /**
   * whoisQuery查询
   * @param
   * @return
   * */
  @GET("${AppConst.PATH_SEGMENTS_URL}app/whoisQuery")
  fun getWhoisQuery(@QueryMap params: Map<String, String>): Observable<RYResponseBase<RYPhoneLocationBean>>

  /**
   * 获取初始化信息
   * @param
   * @return
   * */
  @POST("${AppConst.PATH_SEGMENTS_URL}app/v2/actionLog")
  fun setActionLog(@Body requestBody: RequestBody): Observable<RYResponseBase<RYActivateBean>>
  /**
   * 设置选项日志
   * @param
   * @return
   * */
  @GET("${AppConst.PATH_SEGMENTS_URL}app/unusual/action/ip")
  fun setUnsualIp(@QueryMap params: Map<String, String>): Observable<RYResponseBase<RYActivateBean>>

  /**
   * @param
   * @return
   * */
  @POST("${AppConst.PATH_SEGMENTS_URL}ficteur/equiet")
  fun buryingPointLog(@Body requestBody: RequestBody): Observable<RYResponseBase<RYInstalBean>>

  /**
   * 上报经纬度
   * @param
   * @return
   * */
  @POST("${AppConst.PATH_SEGMENTS_URL}app/v2/reportGeo")
  fun reportGeo(@Body requestBody: RequestBody): Observable<RYResponseBase<RYInstalBean>>



  @GET("${AppConst.PATH_SEGMENTS_URL}vip/commonConfig")
  fun getCommonConfig(@QueryMap params: Map<String, String>): Observable<RYResponseBase<ArrayList<RYCommonConfigBean>>>

  /**
   * Vip通用配置
   * @param
   * @return
   * */
  @GET("${AppConst.PATH_SEGMENTS_URL}vip/issuesList")
  fun issuesList(@QueryMap params: Map<String, String>): Observable<RYResponseBase<ArrayList<RYHelpQuestionBean>>>

  /**
   *售后服务表单
   * @param
   * @return
   * */
  @POST("${AppConst.PATH_SEGMENTS_URL}vip/afterSalesForm")
  fun afterSalesForm(@Body requestBody: RequestBody): Observable<RYResponseBase<RYOpenMemberBean>>

  /**
   *设备扩展信息
   * @param
   * @return
   * */
  @POST("${AppConst.PATH_SEGMENTS_URL}app/v2/deviceInfoExtend")
  fun deviceInfoExtend(@Body requestBody: RequestBody): Observable<RYResponseBase<RYOpenMemberBean>>

}